cargo: add a new stage2 profile
authorLuca Bruno <lucab@debian.org>
Sat, 27 Feb 2016 22:30:03 +0000 (23:30 +0100)
committerLuca Bruno <lucab@debian.org>
Thu, 3 Mar 2016 21:41:21 +0000 (22:41 +0100)
debian/control
debian/rules

index 17c58c9532fef5afc9351df3eb55e8b77240fbd5..367c0be69b763a66c4d25e81668690aef9442f12 100644 (file)
@@ -10,8 +10,9 @@ Build-Depends: debhelper (>= 9),
                pkg-config,
                cmake,
                git,
-               python-dulwich,
-               python-pytoml,
+               cargo (>= 0.7.0) <stage2>,
+               python-dulwich <!stage2>,
+               python-pytoml <!stage2>,
                ca-certificates,
                bash-completion,
                libhttp-parser-dev,
index dcc5fc5b36e2e8cdc79dd4d8494810b341404173..24fc6bdfff0501d78e6aab0bbba285f1eb9b2e00 100755 (executable)
@@ -28,6 +28,11 @@ override_dh_auto_configure:
        ./debian/cargo-vendor-pack.py
 
 override_dh_auto_build:
+ifneq ($(filter stage2,$(DEB_BUILD_PROFILES)),)
+       ln -s `which cargo` $(CURDIR)/cargo-stage0
+       # Workaround for https://github.com/rust-lang/cargo/issues/1423
+       mv $(DEPSDIR) $(CURDIR)/.deps
+else
        # Bootstrap cargo stage0
        ./debian/bootstrap.py \
                --no-clean \
@@ -40,7 +45,8 @@ override_dh_auto_build:
                --target=$(DEB_TARGET_RUST_TYPE)
        # Workaround for https://github.com/rust-lang/cargo/issues/1423
        mv $(DEPSDIR) $(CURDIR)/.deps
-       ln -s `find  $(CURDIR)/.deps -name 'cargo-*' -type f -executable` $(CURDIR)/cargo-stage0
+       ln -s `find $(CURDIR)/.deps -name 'cargo-*' -type f -executable` $(CURDIR)/cargo-stage0
+endif
        # Configure to build cargo using the just-built stage0
        ./configure \
                --prefix=/usr \